/*
import axios from 'axios'

const HOST = '/grt2018'


const GetSideBar =  '/login.d2js' //获取侧边栏
const GetTotalAlarmInfo = '/alarm/statistic.d2js' //获取异常总览数据
const GetChains = '/config_center/cast_chain.d2js' //获取节点
const GetDistortionSummaryById = '/alarm/statistic.d2js' //依据节点id获取动态异常数据
const GetCollectorList =  '/collector'//获取采集点列表
const PostChainOperate = '/config_center/cast_chain.d2js' //登记添加(修改)链路
const GetAlarms = '/alarm/alarm.d2js' //获取分页异常信息
const PostDeleteAlarmData = '/alarm/section_alarm.d2js' //删除异常信息
const GetUsersInfo = '/entity/employee.d2js'
const GetUserDelJson = '/entity/person_del.json' //删除用户前需要这个接口拿到一个json
const GetUserUpDateJson = '/entity/person_new.json'
const GetUserEditJson = '/entity/person_update.json'
const PostUser  = '/entity/employee.d2js'
const PostEmployeeStation = '/entity/employee_station.d2js?'

const createApi = (method, url) => {

  switch(method){
    case 'GET':
      return (params = {}) => {
        const requestUrl = HOST + url
        return new Promise((resolve, reject) => {
          axios({
            method:'get',
            url: requestUrl,
            params:params
          }).then(res => {
            resolve(res)
          }).catch(error => {
            reject(error)
          })
        })
      }
    case 'POST':
      return ({data = {}}) => {
        const requestUrl = HOST + url
        return new Promise((resolve, reject) => {
          axios({
            method:'post',
            url: requestUrl,
            data
          }).then(res => {
            resolve(res)
          }).catch(error =>{
            reject(error)
          })
        })
      }
    default:
      throw new Error('method is undefind')
  }

}

export const getSideBar =  createApi('GET', GetSideBar)

export const getTotalAlarmInfo = createApi('GET', GetTotalAlarmInfo)

export const getChains = createApi('GET',GetChains )

export const getDistortionSummaryById = createApi('GET', GetDistortionSummaryById)

export const getUserDelJson = createApi('GET', GetUserDelJson)
export const getUserUpDateJson = createApi('GET', GetUserUpDateJson)
export const getUserEditJson = createApi('GET',GetUserEditJson)
export const postUser = createApi('POST', PostUser)
// {
  // id:
  // result:
  // handle_remark:
  // _m:'modify'
// }

export const postChainOperate = createApi('POST', PostChainOperate)

export const getCollectorList = createApi('GET', GetCollectorList)
export const postCollectorList = createApi('POST', GetCollectorList)
export const postEmployeeStation = createApi('POST', PostEmployeeStation)
export const getAlarms = createApi('GET', GetAlarms)

export const getUsersInfo = createApi('GET', GetUsersInfo)

export const postAlarms = createApi('POST', GetAlarms)

export const postDeleteAlarmData =  createApi('POST',PostDeleteAlarmData)
*/
